/* Original Author:  Dominick O'Dierno
 * Date: 2007   odiernod@gmail.com     --Originally intended for use with DOMercury:  http://www.odierno.com/domercury
 * Description: The AliasForm is the form to add or modify Alias Items
 * 
 * --CHANGELOG--
 * 
 * */
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DOMercury.Items;

namespace DOMercury.Forms
{
    public partial class AliasForm : Form
    {
        public AliasForm(Alias a)
        {
            InitializeComponent();
           
            txtAlias.Text = a.AliasName;
            txtPath.Text = a.Path;
            txtParameters.Text = a.Parameters;
            txtDescription.Text = a.Description;
        }

        public AliasForm(string AliasName)
        {

            InitializeComponent();
            txtAlias.Text = AliasName;
            txtPath.Text = "";
            txtParameters.Text = "";
            txtDescription.Text = "";
        }

        private void btnBrowse_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog fd = new OpenFileDialog())
            {
                fd.RestoreDirectory = true;
                fd.Title = "Choose an Alias Path";
                fd.AddExtension = true;
                if (fd.ShowDialog() == DialogResult.OK)
                {
                    txtPath.Text = fd.FileName;
                }
            }
            
        }

        public string AliasName
        {
            get
            {
                return txtAlias.Text;
            }
            set
            {
                txtAlias.Text = value;
            }
        }

        public string Path
        {
            get
            {
                return txtPath.Text;
            }
            set
            {
                txtPath.Text = value;
            }
        }

        public string Parameters
        {
            get
            {
                return txtParameters.Text;
            }
            set
            {
                txtParameters.Text = value;
            }
        }

        public string Description
        {
            get
            {
                return txtDescription.Text;
            }
            set
            {
                txtDescription.Text = value;
            }
        }
    }
}